#ifndef _MESSAGE_H_
#define _MESSAGE_H_

#include <staff/common/DataObject.h>
#include "staffmqclientexport.h"

namespace smq
{
  //! message struct
  struct STAFFMQ_CLIENT_EXPORT MessageHeader
  {
    std::string sId;                //!< id
    std::string sQueue;             //!< queue
    std::string sPublisher;         //!< publisher
  };

  //! message struct
  struct STAFFMQ_CLIENT_EXPORT Message: public MessageHeader
  {
    staff::CDataObject tdoMessage;  //!< message
  };

  //! serialization operator
  /*! serialize message header to dataobject
      \param rdoParam - dataobject serialize to
      \param rstStruct - message header
    */
  STAFFMQ_CLIENT_EXPORT staff::CDataObject& operator<<(staff::CDataObject& rdoParam, const MessageHeader& rstStruct);

  //! deserialization operator
  /*! deserialize message header from dataobject
      \param rdoParam - dataobject serialize from
      \param rstStruct - message header
    */
  STAFFMQ_CLIENT_EXPORT staff::CDataObject& operator>>(staff::CDataObject& rdoParam, MessageHeader& rstStruct);

  //! serialization operator
  /*! serialize message to dataobject
      \param rdoParam - dataobject serialize to
      \param rstStruct - message
    */
  STAFFMQ_CLIENT_EXPORT staff::CDataObject& operator<<(staff::CDataObject& rdoParam, const Message& rstStruct);

  //! deserialization operator
  /*! deserialize message from dataobject
      \param rdoParam - dataobject serialize from
      \param rstStruct - message
    */
  STAFFMQ_CLIENT_EXPORT staff::CDataObject& operator>>(staff::CDataObject& rdoParam, Message& rstStruct);
}

#endif // _MESSAGE_H_
